package com.changgou.service.goods.controller;


import com.changgou.common.pojo.Result;
import com.changgou.common.pojo.StatusCode;
import com.changgou.goods.pojo.Spec;
import com.changgou.service.goods.service.SpecService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class SpecController {

    @Resource
    private SpecService specService;

    @GetMapping("/category/{category}")
    public Result findListByCategoryName(@PathVariable String category) {
        List<Spec> specList = specService.findListByCategoryName(category);
        return new Result(true, StatusCode.OK, "", specList);
    }
}
